package edu.predatorwars.shared.models;

import java.io.Serializable;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;

public class Terrain implements Serializable
{
	private boolean traversable;
	private boolean sightBlocked;
	private int terrainType;
	
	public static final int EMPTY = -1;
	public static final int WATER = 0;
	public static final int GRASS = 1;
	public static final int MOUNTAIN = 2;
	
	@JsonCreator
	public Terrain(@JsonProperty("terrainType") int terrainType, @JsonProperty("traversable") boolean traversable, 
			@JsonProperty("sightBlocked") boolean sightBlocked)
	{
		this.terrainType = terrainType;
		this.sightBlocked = sightBlocked;
		this.traversable = traversable;
	}
	
	public void setTerrainType(int type, boolean traversable,boolean sightBlocked) {
		terrainType = type;
	}
	
	public int getTerrainType()
	{
		return terrainType;
	}
	
	public boolean isTraversable()
	{
		return traversable;
	}
	
	public boolean isSightBlocked()
	{
		return sightBlocked;
	}
}
